﻿<UserControl x:Class="$safeprojectname$.CustomerView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    mc:Ignorable="d"
    d:DesignHeight="150" d:DesignWidth="400"
    DataContext="{Binding Source={StaticResource Locator}, Path=CustomerViewModel}"
    >
    
    <Grid x:Name="LayoutRoot" Background="White" Height="150" Width="300">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Text="Customer Id:" Grid.Row="0" />
        <TextBox Grid.Row="0" Grid.Column="1" Height="30"
                 Text="{Binding Path=Model.CustomerId}" />
        <TextBlock Text="Customer Name:" Grid.Row="1" />
        <TextBox Grid.Row="1" Grid.Column="1" Height="30"
                 Text="{Binding Path=Model.CustomerName}" />
        <TextBlock Text="Customer City:" Grid.Row="2" />
        <TextBox Grid.Row="2" Grid.Column="1" Height="30"
                 Text="{Binding Path=Model.City}" />
        <Button Content="New Customer" Grid.Row="3" Grid.ColumnSpan="2" 
                Height="30" Width="100">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <ei:CallMethodAction 
                            TargetObject="{Binding}"
                            MethodName="NewCustomer"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>
    </Grid>
</UserControl>
